home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / internet-tools / amitcp / gpdial / scripts / default.gpdscript next >
Encoding:
Text File  |  1995-06-05  |  2.8 KB  |  113 lines

  1. ;
  2. ; Filename: Default.GPDScript
  3. ;
  4. ; This is the script that I use.  I have included it so it can be
  5. ; used as a template. You should save this file with a different
  6. ; name and modify as required.
  7. ;
  8.    show abort all
  9.    print "Trying to connect to $GPD_SITE "
  10. ;
  11. ; This is needed to allow GPDial to exit without hanging up the modem
  12. ;
  13.    send "$GPD_DTROFF"
  14.    wait "OK" 5 FAILED
  15. LAB REDIAL:
  16. ;
  17. ; Call my provider and wait for a connection
  18. ;
  19.    show abort all
  20.    send "$GPD_PREDIAL $GPD_PHONENUMBER$GPD_SUFDIAL"
  21.    wait "$GPD_CONNECTED" OR "$GPD_BUSY" OR "ENGAGED" 40 HANGUP
  22.    if $GPD_STRING != $GPD_CONNECTED
  23.       goto SMALLPAUSE
  24.    endif
  25. ;
  26. ; My provider asks me to press return before login starts
  27. ;
  28.    wait "Press return to start login:" 30 HANGUP
  29.    send "\r"
  30. ;
  31. ; The LOGIN prompt
  32. ;
  33.    wait "username:" OR "NO CARRIER" 30 HANGUP
  34. ;
  35. ; My provider will hangup at this point if there is not enough
  36. ; resources to allow me to login.
  37. ;
  38.    if $GPD_STRING = "NO CARRIER"
  39.       goto FAILED
  40.    endif
  41.    send $GPD_USERNAME
  42. ;
  43. ; The PASSWORD prompt
  44. ;
  45.    wait "password:" 30 HANGUP
  46.    send $GPD_PASSWORD hide
  47. ;
  48. ; The type of connection I wish 
  49. ;
  50.    wait "ppp:" 30 HANGUP
  51.    send "slip\r"
  52. ;
  53. ; Find out my IP address (It is assigned at login time)
  54. ; The provider sends the string
  55. ; "You're connected to 256.256.256.256 Your address is 256.256.256.256."
  56. ;
  57.    waitline "Your address is" 30 HANGUP
  58. ;
  59. ; Extract the dynamicaly allocated IP address.
  60. ;
  61.    print "Connection established to $GPD_SITE - Starting TCP/IP"
  62.    extract $GPD_LINE 8
  63. ;
  64. ; Now remove the full stop that is at the end of the word
  65. ;
  66.    remchar $GPD_VALUE -1
  67. ;
  68. ; I need to set this IP address into 3 files. startnet, netdb-myhost and
  69. ; rhslip0.config. I do this by having ".store" files for each with the IP
  70. ; address of 0.0.0.0 I then do a find and replace (using the Replace
  71. ; command)
  72. ;
  73.    execute "replace AmiTCP:bin/startnet.store AmiTCP:bin/startnet 0.0.0.0 $GPD_TEXT -s" ERRORMSG
  74.    execute "replace AmiTCP:db/netdb-myhost.store AmiTCP:db/netdb-myhost 0.0.0.0 $GPD_TEXT -s" ERRORMSG
  75.    execute "replace ENVARC:sana2/rhslip0.config.store ENVARC:sana2/rhslip0.config 0.0.0.0 $GPD_TEXT -s" ERRORMSG
  76. ;
  77. ; Now close the serial device so that we can start AmiTCP
  78. ;
  79.    close
  80. ;
  81. ; Now start TCP
  82. ;
  83.    execute "execute AmiTCP:bin/startnet" ERRORMSG
  84.    execute "AmiTCP:bin/online rhslip.device 0" ERRORMSG
  85.    print "TCP/IP now running"
  86.    quit
  87. ;
  88. ; By now everything is up and running (hopefully) so we quit GPDial
  89. ;
  90. ; The following lines of script will be jumped to by an error
  91. ;
  92. LAB FAILED:
  93.    printerror "Error connecting"
  94.    end
  95. ;
  96. LAB ERRORMSG:
  97.    printerror "Error starting TCP/IP - Check files"
  98.    end
  99. ;
  100. LAB HANGUP:
  101.    send $GPD_HANGUP
  102.    goto SMALLPAUSE
  103.    end
  104. ;
  105. LAB SMALLPAUSE:
  106.    print "Hanging up and trying again"
  107.    pause 10
  108.    print "Redialing .."
  109.    goto REDIAL
  110.    end
  111. ;
  112. ; EOF
  113.